import http from "@/utils/http"
// import axios from "axios";
//获取标签分类信息
export function SKU_TypeTree(params) {
    return http.post('/sys-tag-dictionary/treeTagDictionary', params)
}
//获取表格列表数据
export function SKU_TableList(params) {
    return http.post('/by-sku/select/page', params)
}
//获取标签类型数据
export function SKU_tgasType(params) {
    return http.post('/sys-tag-dictionary/treeTagDictionary', params)
}
//新建SKU信息
export function SKU_add(params) {
    return http.post('/by-sku/add', params)
}
//修改SKU信息
export function SKU_update(params) {
    return http.post('/by-sku/update', params)
}
//批量删除
export function SKU_batchDelete(params) {
    return http.post('/by-sku/batchDelete', params)
}
//批量归档
export function SKU_batchIsOnFile(params) {
    return http.post('/by-sku/batchIsOnFile', params)
}
//批量更改分类
export function SKU_batchClassify(params) {
    return http.post('/by-sku/batchClassify', params)
}
//批量下载保存SKU模板
export function SKU_upLoadBatchSave(params) {
    return http.post('/by-sku/upLoadBatchSave', params)
}
//批量下载批量SKU模板
export function SKU_upDow() {
    return http.blob('/by-sku/upDow')
}
//输出为PDF
export function SKU_PDF6030(params) {
    return http.blob('/by-barcode/pdf/6030/?' + params)
}
//输出为PDF
export function SKU_PDFA4(params) {
    return http.blob('/by-barcode/pdf/A4?' + params)
}
//是否存在SKU
export function SKU_IsSku(params) {
    return http.post('/by-sku/select/' + params)
}
//是否使用SKU
export function SKU_useSku(params) {
    return http.get('/by-product-info/is-use/' + params)
}
//sku转换单位
export function SKU_changeUnit(params) {
    return http.post('/by-sku/unit/sku', params)
}





// export function upXls(url) {
//     return axios({
//         url,
//         method: "post",
//         responseType: "blob",
//         headers: {
//           "Content-Type": "application/json",
//         },
//       })
//         .then((res) => {
//             console.log(res);
//           const blob = new Blob([res.data], {
//             type: "application/vnd.ms-excel",
//           });
//           const fileName = "SKU列表.xls";
//           const linkNode = document.createElement("a");
//           linkNode.download = fileName; //a标签的download属性规定下载文件的名称
//           linkNode.style.display = "none";
//           linkNode.href = URL.createObjectURL(blob); //生成一个Blob URL
//           document.body.appendChild(linkNode);
//           linkNode.click(); //模拟在按钮上的一次鼠标单击
//           URL.revokeObjectURL(linkNode.href); // 释放URL 对象
//           document.body.removeChild(linkNode);
//         })
//         .catch((err) => {
//           console.log(err);
//         });
// }